﻿<!doctype html>
<html>
<head>
    <meta charset='utf-8'/>
    <title>派对</title>
    <meta name='viewport' content='width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no'/>
    <meta name='apple-mobile-web-app-capable' content='yes' />
    <meta name='full-screen' content='true' />
    <meta name='screen-orientation' content='portrait' />
    <meta name='x5-fullscreen' content='true' />
    <meta name='360-fullscreen' content='true' />
    <meta http-equiv='expires' content='0' />
    <script src="__STATIC__/js/zepto.min.js"></script>
    <script src="__STATIC__/js/common.js?v=20170324"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
        var eid = getQueryString('id')?getQueryString('id'):false;
        var eventid ='{$eventid}';
        function setSessionStorage(){
            var sessionstorage = window.sessionStorage;
            sessionstorage.setItem('eventStatus', "{$eventStatus}");
            sessionstorage.setItem('id', "{$id}");
            sessionstorage.setItem('nickname', "{$nickname}");
            sessionstorage.setItem('sex', "{$sex}");
            sessionstorage.setItem('headimgurl', "{$headimgurl}");
            sessionstorage.setItem('province', "{$province}");
            sessionstorage.setItem('city', "{$city}");
            sessionstorage.setItem('country', "{$country}");
            sessionstorage.setItem('friends', '{$friends}');
            sessionstorage.setItem('friendeventid', '{$friendeventid}');
            sessionstorage.setItem('eventid', '{$eventid}');
            sessionstorage.setItem('eventusername', '{$eventusername}');
        }
        setSessionStorage();

        //微信分享设置
        wx.config({
            debug: false,
            appId: '{$appId}',
            timestamp: {$timestamp},
            nonceStr: '{$nonceStr}',
            signature: '{$signature}',
            jsApiList: [
                'onMenuShareTimeline',
                'onMenuShareAppMessage',
                'hideAllNonBaseMenuItem',
                'showMenuItems'
            ]
        });
        wx.ready(function () {
            wx.hideAllNonBaseMenuItem({
                success: function () {

                },
                fail: function (res) {

                }
            });
            wx.showMenuItems({
                menuList: [
                    'menuItem:share:timeline',
                    'menuItem:share:appMessage'
                ]
            });
            var title = '';
            var desc = '';
            var link = '';
            var imgUrl = "http://www.cssw3c.com/__STATIC__/images/share.jpg";
            if(eventid){
                title = '{$eventusername}正在参与“开聚会”赢免费电影票活动，需要你的参加!';
                desc = '{$eventusername}正在参与“开聚会”赢免费电影票活动，需要你的参加!;';
                link = "http://www.cssw3c.com/management/public/?id="+eventid;
            }else{
                title = '“开聚会”赢免费电影票，快快来参加吧！';
                desc = '“开聚会”赢免费电影票，快快来参加吧。数量有限，先到先得!';
                link = "http://www.cssw3c.com/management/public/";
            }

            wx.onMenuShareTimeline({
                title: title, // 分享标题
                link: link, // 分享链接
                imgUrl: imgUrl, // 分享图标
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });
            wx.onMenuShareAppMessage({
                title: title, // 分享标题
                desc: desc, // 分享描述
                link: link, // 分享链接
                imgUrl: imgUrl, // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });
        });
    </script>
</head>
<body>
    <script src="__STATIC__/js/libs/laya.core.min.js?v=20170348"></script>
    <script src="__STATIC__/js/libs/laya.webgl.min.js?v=20170348"></script>
    <script src="__STATIC__/js/libs/laya.ui.min.js?v=20170348"></script>
    <script src="__STATIC__/js/ui/layaUI.max.all.js?v=20170355"></script>
    <script src="__STATIC__/js/main.min.js?v=20170355"></script>
</body>
</html>
